package com.sojson.project.pay.controller.ali;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sojson.project.pay.service.ali.PayAliService;
import com.sojson.result.Result;

import io.swagger.annotations.Api;

/**
 * 支付宝支付控制器
 * 
 * @author liu
 * @date 2021-03-24
 */
@Api(tags = "支付宝支付管理")
// @RestController
@RequestMapping(value = "/payAli")
public class PayAliController {

    @Autowired
    private PayAliService payAliService;

    /**
     * 认证授权
     * 
     * @return
     * @throws Exception 
     */
    @PostMapping("/login")
    @PreAuthorize("@ss.login()")
    public void login() throws Exception {
        payAliService.login();
    }

    /**
     * 认证授权
     * 
     * @return
     * @throws Exception 
     */
    @GetMapping("/updateInfo")
    public Object updateInfo() throws Exception {
        return Result.success(payAliService.updateInfo());
    }

}